<template>
  <div>
    <div>
      <span>请输入要发给父组件的值:</span>
      <Input v-bind:value="inputValue" 
       placeholder="Enter something..." 
       style="width: 260px;margin-left: 20px;margin-right: 20px;" 
       @input="handleInputChange"/>
      <Button type="primary" @click.native="sendValueToFather">清空</Button>
    </div>
  </div>
</template>

<script>
export default {
  name: "MyChildTwo",
  data() {
    return {
      inputValue: ""
    };
  },
  methods: {
    sendValueToFather: function() {
      this.inputValue = '';
      this.$emit('handClick', this.inputValue);
    },
    handleInputChange: function(event){
          debugger;
        this.inputValue = event;
        this.$emit('handClick', this.inputValue);
    }
  }
};
</script>

<style>
</style>